package com.quanyan.ic.model;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by zhuo.shi on 2017/8/22.
 *
 * 客户端上报的开关灯操作信息
 */
public class LightOp {

    private Integer placeId;
    private String placeName;   //场馆名称
    private Integer siteId;
    private Integer status;     //0 关 1 开
    private Integer type;       //1 手动 2 自动
    private String time;        //操作时间
    private boolean success;    //开关成功|失败
    private Integer reasonType;
    private String reason;

    public Integer getReasonType() {
        return reasonType;
    }

    public void setReasonType(Integer reasonType) {
        this.reasonType = reasonType;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public Integer getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Integer placeId) {
        this.placeId = placeId;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public Integer getSiteId() {
        return siteId;
    }

    public void setSiteId(Integer siteId) {
        this.siteId = siteId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }


    public String getTime() {
        if (time == null){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            time = sdf.format(new Date());
        }
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }
}
